// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		{
			WORD	wVersionRequested;
			WSADATA wsaData;
			int		err;

			wVersionRequested = MAKEWORD( 2, 2 );

			err = WSAStartup( wVersionRequested, &wsaData );
			if ( err != 0 ) 
			{
				return FALSE;
			}
			if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 ) 
			{			
				WSACleanup();

				return FALSE;
			}

#ifdef dkq_test_net
			//g_xLog.CreateLogDir("g_TGNetSDK",0x1001);
#endif
		}
		break;
	case DLL_THREAD_ATTACH:
		break;
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		{
			WSACleanup();
		}
		break;
	}
	return TRUE;
}

